<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use Carbon\Carbon;

class TypeResource extends JsonResource
{
    public function toArray($request)
    {
        $resource = $this->resource;
    
        return [
            'id'                => (int)$resource->id,
            'name'                => $resource->name,
            'image'             => img_path($resource->image),
            'order'              => $resource->order,
            'is_shown'              => $resource->is_shown,
            'created_at'          =>(string)$resource->created_at,
            
        ];
    }
}
